Ze scripts

Vos sites en questions

Sans commentaire

Y a un risque ?

<Files *.inc> 
order deny,allow 
deny from all 
</Files>

Essaie encore une fois

<input type="radio" onClick="reponse(+1);" name="agecapitaine" value="6jours"> 6 jours

<script type="text/javascript">
bonneReponses=0;
max=3;
function reponse(i)
{
	bonneReponses=bonneReponses+i;
	if (bonneReponses>=max)
	{
		alert("Bravo, etc.");
	}
}
</script>

Un titre qui bouge

<script type="text/javascript">
var vitesse=100;
texte="Ma page à moi";
c=0;
function anime()
{
	document.title='';
	if(c<texte.length)
	{
		document.title=texte.substring(0,++c);
	}
	t=setTimeout('anime(texte)',vitesse);
	if(c==texte.length)
	{
		clearTimeout(t);
	}
}
anime();
</script>

Arrondissez-moi ça

function arrondi(x)
{
	return (Math.round(x*100))/100;
}

Quand vous souhaitez arrondir un nombre, appelez la fonction : 

resultat = arrondi(monNombre);

WebJavaScript

Le script de mai
<BODY>
<FORM NAME="myform">
<H3>Liste 1 :</H3>
<SELECT NAME="platform"
onChange="selectPlatform();">
<OPTION SELECTED VALUE="title">Sélectionnez une plate-forme</OPTION>
<OPTION VALUE="PC">PC</OPTION>
<OPTION VALUE="MAC">Mac</OPTION>
</SELECT><br>
<H3>Liste 2 :</H3>
<SELECT SIZE="3" MULTIPLE NAME="site"
onChange="selectSite();">
<OPTION SELECTED VALUE="null">Aucune plate-forme sélectionnée</OPTION>

<OPTION><OPTION><OPTION><OPTION>

</SELECT>
</FORM>

<SCRIPT>

myPCtext = new Array();
myPCtext[1] = "PC Format";
myPCtext[2] = "PC Gamer";

myPCvalue = new Array();
myPCvalue[1] = "http://www.pcformat.co.uk";
myPCvalue[2] = "http://www.pcgamer.co.uk";

myMactext = new Array();
myMactext[1] = "MacFormat";
myMactext[2] = "Your iMac";

myMacvalue = new Array();
myMacvalue[1] = "http://www.macformat.co.uk";
myMacvalue[2] = "http://www.yourimac.co.uk";

function selectPlatform(){
var num = document.myform.platform.selectedIndex;
if (num == 1) {populateSite(myPCtext, myPCvalue);}
if (num == 2) {populateSite(myMactext, myMacvalue);}
}

function populateSite(mySitestext, mySitesvalue){
document.myform.site.selectedIndex = 0;
document.myform.site.options[0].text = "Select a Site";
for (count = 1; count < mySitestext.length; count ++){
document.myform.site.options[count].text = mySitestext[count];
document.myform.site.options[count].value = mySitesvalue[count];
}
}

function selectSite(){
var num = document.myform.site.selectedIndex;
document.location.href = document.myform.site.options[num].value;
}

</SCRIPT>
</BODY>

Maîtrisez les formulaires

<form name="monform" method="post" action="mailto:toto@bimbo.fr?content-type=text/html" enctype="text/plain">
<table border="0" cellpadding="5" cellspacing="1">
	<tr bgcolor="#85C1DE">
		<td><font face="arial" size="2">Votre prénom</font></td>
		<td colspan="2"><input type="text" name="prenom" size="25" maxlength="30"></td>
	</tr>
	<tr bgcolor="#8D9FDE">
		<td><font face="arial" size="2">Votre e-mail</font></td>
		<td colspan="2"><input type="text" name="e-mail" size="25" maxlength="30"></td>
	</tr>	
	<tr bgcolor="#DEC9AF">
		<td><font face="arial" size="2">Vous aimez</font></td>
		<td bgcolor="#CFBBDE"><font face="arial" size="2"><input type="checkbox" name="aimeleschiens"> Les chiens
			<br><input type="checkbox" name="aimeleschats"> Les chats
			<br><input type="checkbox" name="aimelenutella"> Le Nutella (tm)</font></td>
		<td bgcolor="#CFBBDE"><font face="arial" size="2"><input type="checkbox" name="aimelesarbres"> Les arbres
			<br><input type="checkbox" name="aimeleselfes"> Les elfes
			<br><input type="checkbox" name="aimelenspingouins"> Les pingouins</font></td>		
	</tr>
	<tr bgcolor="#DEA1A2">
		<td><font face="arial" size="2">Vous préférez</font></td>
		<td colspan="2"><font face="arial" size="2"><input type="radio" name="prefere" value="Riri" checked> Riri
			<input type="radio" name="prefere" value="Fifi"> Fifi
			<input type="radio" name="prefere" value="Loulou"> Loulou</font>
		</td>
	</tr>	
	<tr bgcolor="#C4DECB">
		<td colspan="3"><center><input type="submit" value="Envoyer"></center></td>
	</tr>
	<tr bgcolor="#C4DECB">
		<td colspan="3"><center><input type="reset" value="Réinitialiser"></center></td>
	</tr>
</form>